// 云函数入口文件
const cloud = require('wx-server-sdk')
cloud.init()
const db = cloud.database()

// 云函数入口函数
exports.main = async (event, context) => {

// var Unit__1 = [1, ""]
// var Unit__2 = [2, ""]
// var Unit__3 = [3, ""]
// var Unit__4 = [4, ""]
// var Unit__5 = [5, ""]
// var Unit__6 = [6, ""]
// var Unit__7 = [7, ""]
// var Unit__8 = [8, ""]
// var list = { Unit__1, Unit__2, Unit__3, Unit__4, Unit__5, Unit__6, Unit__7, Unit__8 }


//   var Unit__1 = [1, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a1.docx?sign=0bf5ef6774bec7707e4366f5ca579c2f&t=1589193932"]
//   var Unit__2 = [2, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a2.docx?sign=c5ac31658cce060f01df7ef48141efa0&t=1589193942"]
//   var Unit__3 = [3, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a3.docx?sign=4319f6b9b58aee7818301372bfd7d5d0&t=1589193949"]
//   var Unit__4 = [4, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a4.docx?sign=36ec91a7d36b86aa1f7c34ba0058c77c&t=1589193958 "]
//   var Unit__5 = [5, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a5.docx?sign=61a1883465a65ad4186904984f0991bf&t=1589193968"]
//   var Unit__6 = [6, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a6.docx?sign=7f0135b0a4411cf98ac04f9847f78c68&t=1589193975"]
//   var Unit__7 = [7, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a7.docx?sign=78edd1eba793f797fee7913ab85d9aac&t=1589193983"]
//   var Unit__8 = [8, "https://6461-daanquanyou-rlnyt-1301765700.tcb.qcloud.la/welearn/xinbiaozhun/a8.docx?sign=37492e1cb1ca9a38fad65789a5516c2c&t=1589194005"]
// var list = { Unit__1, Unit__2, Unit__3, Unit__4, Unit__5, Unit__6, Unit__7, Unit__8 }

  db.collection("book1").add({
    data:{
browse:1584,
chubanshe:"上海外语教育出版社",
list:list,
      name:"新标准高职公共英语系列教材：实用综合教程（第二版)2",
sort:"welearn",
sort1:"zonghe",
      // picture:""
      picture: "
    }
  })
  .then(res=>{
console.log(res)
  })
  .catch(err=>{
console.log(err)
  })
}
